fix: corrige blockers do outbox relay + separa documentação OpenAPI - #10
Merged
Conversation
…mocks de teste - renomeia log para LOG em OutboxRelay (ConstantName do Checkstyle) - troca KafkaTemplate<String,String> por KafkaTemplate<Object,Object>, único bean que o Spring Boot autoconfigura; generics invariantes faziam o contexto falhar no boot com NoSuchBeanDefinitionException - adiciona @EnableScheduling na aplicação, sem o qual o @scheduled do OutboxRelay nunca disparava - adiciona mock de OutboxEventPort em CreateChargeServiceTest e verifica a chamada a record() nos casos de sucesso - aplica spotless nos arquivos do outbox introduzidos anteriormente
…erface dedicada Cria ChargeControllerDoc com @RequestMapping, @Valid/@RequestBody e as anotações @Operation/@ApiResponses/@tag do SpringDoc; ChargeController passa a implementar a interface e mantém apenas @RestController e a lógica do endpoint. Validado que /v3/api-docs e /swagger-ui continuam expondo a documentação completa do endpoint /charges.
lmoraesdev
marked this pull request as draft
July 22, 2026 21:32
lmoraesdev
marked this pull request as ready for review
July 22, 2026 21:32
O gatilho pull_request só cobria base=main, mas a proteção de branch em develop exige o check "Lint + Unit Tests". PRs contra develop nunca disparavam o workflow, deixando o check obrigatório permanentemente pendente.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes — outbox relay
logparaLOGemOutboxRelay(CheckstyleConstantName).KafkaTemplate<String, String>porKafkaTemplate<Object, Object>noOutboxRelay— o bean autoconfigurado pelo Spring Boot 3.5.3 éKafkaTemplate<Object, Object>, e generics invariantes faziam o contexto falhar no boot comNoSuchBeanDefinitionException.@EnableSchedulingemPaymentApiApplication— sem isso o@ScheduleddoOutboxRelaynunca disparava.@Mock OutboxEventPortemCreateChargeServiceTeste verifica a chamada arecord(...)nos casos de sucesso — o construtor deCreateChargeServicepassou a exigir esse segundo parâmetro e o teste não estava atualizado, gerandoNullPointerException.spotless:applynos arquivos do outbox.Refactor — documentação OpenAPI
@Operation,@ApiResponses,@Tag) e do Spring MVC (@RequestMapping,@Valid,@RequestBody) doChargeControllerpara uma interface dedicadaChargeControllerDoc.ChargeControllerpassa a implementar a interface, mantendo apenas@RestControllere a lógica do endpoint.Validação
./mvnw verifycompleto (spotless, checkstyle, testes unitários e de integração com Testcontainers): BUILD SUCCESS./v3/api-docse/swagger-uicontinuam expondo a documentação completa do endpoint/charges.POST /chargestestado manualmente: retorna 201 e grava a linha correspondente emoutbox_events.